function changeInfo() {
    var u_name = document.getElementById("name").value;
    var u_phone = document.getElementById("phone").value;
    // 用户名去除空格
    u_name = u_name.replace(/\s+/g, "");
    if (u_name.length == 0) {
        alert("用户名不可为空！");
        return false;
        
    }
    if (u_phone.length != 11) {
        alert("手机号格式错误！");
        return false;
    }    
}

function changePassword() {
    var new_password = document.getElementById("new_pwd").value;
    var confirm_password = document.getElementById("renew_pwd").value;
    if (new_password.length < 8 || new_password.length > 20) {
        alert("密码长度不符合要求！");
        return false;
    }
    if (new_password != confirm_password) {
        alert("两次输入的密码不一致！");
        return false;
    }
}